<?php
namespace app\test\controller;
use think\Db;
use think\Controller;
class Confirmorder extends Controller
{
    public function index()
    {
        $shopcart_id=input('shopcart_id');
        $order_total=input('order_total');

        //$order_id=db('dachang_order')->where("shopcart_id='{$shopcart_id}'")->field('order_id')->select();
        //$data=db('order')->where("order_num={$order_num}")->field('shopcart_id,order_id')->select();
        $this->assign('order_total',$order_total);
    	

       $shopcartId=explode(',', $shopcart_id);
       dump($shopcartId);
       $text=[];
       for($i=0;$i<count($shopcartId);$i++)
      {
        if($shopcartId[$i]!='')
        {
        $shopcartNewid=$shopcartId[$i];
        $data=db('dachang_product')->alias('a')->join('dachang_shopcart b','a.product_id=b.product_id')->where("shopcart_id={$shopcartNewid}")->select();
        
        
       foreach ($data as $val) 
        {

         $list=$val;  
         $text[]=$list;

        }
       }

      }
    	dump($text);
    	$this->assign('text',$text);

      return view('./test1/order');
    }
    
}